package com.lxl.bt.net;

import com.google.gson.JsonObject;
import com.lxl.bt.bean.AgentIncomeBean;
import com.lxl.bt.bean.AgentListBean;
import com.lxl.bt.bean.AgentNumberBean;
import com.lxl.bt.bean.AppVersionBean;
import com.lxl.bt.bean.Banner;
import com.lxl.bt.bean.CreateOrderBody;
import com.lxl.bt.bean.DianliBean;
import com.lxl.bt.bean.FileBackBean;
import com.lxl.bt.bean.Inbean;
import com.lxl.bt.bean.LoginBody;
import com.lxl.bt.bean.MessageBean;
import com.lxl.bt.bean.NewBean;
import com.lxl.bt.bean.NoticeBean;
import com.lxl.bt.bean.OnlyCode;
import com.lxl.bt.bean.OrderListResult;
import com.lxl.bt.bean.OutBean;
import com.lxl.bt.bean.ProductBean;
import com.lxl.bt.bean.RecordBean;
import com.lxl.bt.bean.UserAccountBean;
import com.lxl.bt.bean.WakuangBean;

import java.util.ArrayList;
import java.util.List;

import okhttp3.MultipartBody;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.DELETE;
import retrofit2.http.GET;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.Query;

/**
 * @Author : xinlong.lv
 */
public interface NetApi {

    @POST("api/login/getVerificationCode")
    Call<Result<String>> getyCode(@Body JsonObject jsonObject);


    @POST("api/login/addUser")
    Call<Result<OnlyCode>> addUser(@Body JsonObject jsonObject);


    @POST("api/login/loginByPhone")
    Call<Result<ArrayList<LoginBody>>> loginByPhone(@Body JsonObject jsonObject);

    @POST("api/login/resetPassword")
    Call<Result<String>> resetPassword(@Body JsonObject jsonObject);

    @DELETE("api/login/logout")
    Call<Result<String>> logout(@Body JsonObject jsonObject);

    @GET("api/product")
    Call<Result<ArrayList<ProductBean>>> product(@Query("page") int page, @Query("size") int size,
                                                 @Query("sort") ArrayList<String> sort,
                                                 @Query("status") String status, @Query("type") String type);

    @GET("api/product/getLightPakeage")
    Call<Result<ArrayList<DianliBean>>> getLightPakeage(@Query("productId") String productId);

    @POST("api/order/order")
    Call<Result<CreateOrderBody>> createOrder(@Query("couponId") String couponId,
                                              @Query("dictDetailId") String dictDetailId,
                                              @Query("num") String num,
                                              @Query("payPrice") String payPrice,
                                              @Query("payType") String payType,
                                              @Query("productId") String productId);

    /**
     * type 0 算币 1：算金额
     */
//    private String type;
//
//    //购买数量
//    private BigDecimal num;
//
//    //钱
//    private BigDecimal money;
//
//    //商品id
//    private Long productId;
    @POST("api/order/getOrderPrice")
    Call<Result<String>> getOrderPrice(@Query("type") String type,
                                       @Query("num") String num,
                                       @Query("money") String payPrice,
                                       @Query("productId") String productId);

    //我的账户
    @GET("api/btUserAccount")
    Call<Result<UserAccountBean>> btUserAccount();

    //btUserAccount/cashwith 提币划转
    @POST("api/btUserAccount/cashwith")
    Call<Result<String>> cashwith(
            @Query("coinName") String coinName,
            @Query("code") String code,
            @Query("moneyAddress") String moneyAddress,
            @Query("num") String num
    );


    //api/btUserAccount/commissionByCoinName获取手续费
    @GET("api/btUserAccount/commissionByCoinName")
    Call<Result<String>> commissionByCoinName(
            @Query("coinName") String coinName
    );


    //api/btUserAccount/limitWithdraw获取提币最小限制
    @GET("api/btUserAccount/limitWithdraw")
    Call<Result<String>> limitWithdraw(
            @Query("coinName") String coinName
    );

    //api/btUserAccount/btUserAccount/rechargeAddress充值账户地址
    @POST("api/btUserAccount/rechargeAddress")
    Call<Result<String>> rechargeAddress(
            @Query("coinName") String coinName
    );

    ///api/btUserAccount/totalInput  累计投入
    @GET("api/btUserAccount/totalInput")
    Call<Result<Inbean>> totalInput(
            @Query("coinName") String coinName
    );


    //homeApi/bannerList：homeApi/bannerList
    //    首页：banner列表
    @GET("homeApi/bannerList")
    Call<Result<ArrayList<Banner>>> homebannerList();

    ///auth/informationList
    //Information：资讯列表  status  排序规则 0:发布时间排序:最新资讯，1：浏览量排序：最热资讯
    @GET("auth/informationList")
    Call<Result<ArrayList<NewBean>>> informationList(
            @Query("status") String status
    );

    ///api/btUserAccount/withdrawIsOpen提现开关
    @GET("api/btUserAccount/withdrawIsOpen")
    Call<Result> withdrawIsOpen();


    ///api/btUserAccount/productOut  累计产出||预计待产出
    @GET("api/btUserAccount/productOut")
    Call<Result<OutBean>> productOut(
            @Query("coinName") String coinName
    );

    ///api/tailgFeedBack  广播消息
    @GET("api/tailgFeedBack")
    Call<Result<ArrayList<NoticeBean>>> tailgFeedBack();

    //挖矿
    @POST("api/btUserAccount/found")
    Call<Result<WakuangBean>> found(
            @Query("coinName") String coinName
    );


    //api/login/tokenIsValid判断token是否过期
    @POST("api/login/tokenIsValid")
    Call<Result<Boolean>> tokenIsValid(@Query("token") String token);


    //btUserAccount/isValid 是否认证0：未认证 1认证
    @POST("api/btUserAccount/isValid")
    Call<Result<Integer>> isValid();

    //btUserAccount/queryAccoutRecords 流水记录
    @POST("api/btUserAccount/queryAccoutRecords")
    Call<Result<RecordBean>> queryAccoutRecords(
            @Query("coinName") String coinName,
            @Query("incomeType") String incomeType,
            @Query("page") int page,
            @Query("size") int size,
            @Query("sort") ArrayList<String> sort
    );

    @GET("api/order")
    Call<Result<OrderListResult>> queryOrders(
            @Query("coinName") String coinName,
            @Query("countStatus") String countStatus,
            @Query("type") String type,
            @Query("page") int page,
            @Query("size") int size,
            @Query("sort") ArrayList<String> sort
    );


    //btUserAccount/recharge 充值
    @POST("api/btUserAccount/recharge")
    Call<Result<String>> recharge(
            @Query("coinName") String coinName,
            @Query("flagStr") String flagStr,
            @Query("num") String num
    );


    //btUserAccount/userValid 实名认证
    @POST("api/btUserAccount/userValid")
    Call<Result<String>> userValid(
            @Query("card") String card,
            @Query("userName") String userName,
            @Query("videoUrl") String videoUrl,
            @Query("cardUrl") String cardUrl
    );

    //上传文件
    @Multipart
    @POST("api/aliOssContent")
    Call<Result<FileBackBean>> aliOssContent(@Part MultipartBody.Part file);

    //消息api/messageCenter/getUserInfoByUserId
    @POST("api/messageCenter/getUserInfoByUserId")
    Call<Result<ArrayList<MessageBean>>> getUserInfoByUserId(
            @Query("page") int page,
            @Query("size") int size,
            @Query("sort") ArrayList<String> sort
    );

    //是否有新消息
    @GET("api/messageCenter/pushMsgIsExistence")
    Call<Result<Boolean>> pushMsgIsExistence();

    //昨日收益 api/btUserAccount/yesIncome
    @GET("api/btUserAccount/yesIncome")
    Call<Result<Double>> yesIncome(
            @Query("coinName") String coinName
    );

    @GET("api/proxy")
    Call<Result<AgentNumberBean>> agentNumber();

    @POST("api/proxy/queryProxyUsers")
    Call<Result<AgentListBean>> agentList(
            @Query("page") int page,
            @Query("size") int size,
            @Query("type") int type,
            @Query("sort") List<String> sort
    );

    @POST("api/proxy/queryReUserIncomes")
    Call<Result<AgentIncomeBean>> agentIncomes(
            @Query("page") int page,
            @Query("size") int size,
            @Query("userId") int userId,
            @Query("sort") List<String> sort
    );

    @GET("api/tailgAppVersion")
    Call<Result<AppVersionBean>> queryAppVersion(@Query("Type") int Type);

}
